/*
 * @Author: ischen.x ischen.x@foxmail.com
 * @Date: 2024-07-11 13:31:52
 * @LastEditors: ischen.x ischen.x@foxmail.com
 * @LastEditTime: 2024-07-19 15:27:39
 * 
 * Copyright (c) 2024 by ischen.x, All Rights Reserved. 
 */

#ifndef __AT1337_H
#define __AT1337_H

#include <stdint.h>
#include <time.h>

#define AT1337_IIC_ADDR	0x64

typedef struct at1337{
	uint8_t Seconds;
	uint8_t Minutes;
	uint8_t Hours;
	uint8_t Day;
	uint8_t Date;
	uint8_t Mounth_Century;
	uint8_t year;
    uint8_t Alarm_1_Seconds;
    uint8_t Alarm_1_Minutes;
    uint8_t Alarm_1_Hours;
    uint8_t Alarm_1_Day;
    uint8_t Alarm_1_Date;
    uint8_t Alarm_2_Seconds;
    uint8_t Alarm_2_Minutes;
    uint8_t Alarm_2_Hours;
    uint8_t Alarm_2_Day;
    uint8_t Alarm_2_Date;
    uint8_t Control;
    uint8_t Status;
}at1337_reg_type;

int at1337_get_time(struct tm *time_struct);
int at1337_set_time(struct tm *time_struct);

#endif /* __AT1337_H */

